package com.sz.bi.entity

import org.springframework.data.jpa.repository.JpaSpecificationExecutor
import org.springframework.data.repository.CrudRepository
import org.springframework.stereotype.Repository
import java.sql.Timestamp
import javax.persistence.Column
import javax.persistence.Entity
import javax.persistence.Id
import javax.persistence.Table

@Entity
@Table(name = "T_MBG_BGFORM")
data class TMbgBgForm(
        @Id
        @Column(name = "FID")
        val fid: String? = null,

        @Column(name = "FCREATORID")
        val fcreatorid: String? = null,

        @Column(name = "FCREATETIME")
        val fcreatetime: Timestamp? = null,

        @Column(name = "FLASTUPDATEUSERID")
        val flastupdateuserid: String? = null,

        @Column(name = "FLASTUPDATETIME")
        val flastupdatetime: Timestamp? = null,

        @Column(name = "FCONTROLUNITID")
        val fcontrolunitid: String? = null,

        @Column(name = "FNAME")
        val fname: String? = null,

        @Column(name = "FNUMBER")
        val fnumber: String? = null,

        @Column(name = "FDESCRIPTION")
        val fdescription: String? = null,

        @Column(name = "FYEAR")
        val fyear: Int? = null,

        @Column(name = "FPERIOD")
        val fperiod: Int? = null,

        @Column(name = "FSTARTDATE")
        val fstartdate: Timestamp? = null,

        @Column(name = "FENDDATE")
        val fenddate: Timestamp? = null,

        @Column(name = "FAUDITORID")
        val fauditorid: String? = null,

        @Column(name = "FTEMPLATEID")
        val ftemplateid: String? = null,

        @Column(name = "FCOMPANYID")
        val fcompanyid: String? = null,

        @Column(name = "FPERIODTYPE")
        val fperiodtype: Int? = null,

        @Column(name = "FPUBLICSTATUS")
        val fpublicstatus: Int? = null,

        @Column(name = "FPUBLISHEDSTATUS")
        val fpublishedstatus: Int? = null,

        @Column(name = "FCOMMITTEDSTATUS")
        val fcommittedstatus: Int? = null,

        @Column(name = "FHANDLESTATUS")
        val fhandlestatus: Int? = null,

        @Column(name = "FSOURCETYPE")
        val fsourcetype: Int? = null,

        @Column(name = "FORGTREEID")
        val forgtreeid: String? = null,

        @Column(name = "FCURRENCYID")
        val fcurrencyid: String? = null,

        @Column(name = "FAUDITEDTIME")
        val fauditedtime: Timestamp? = null,

        @Column(name = "FAUDITEDSTATUS")
        val fauditedstatus: Int? = null,

        @Column(name = "FCHECKEDSTATUS")
        val fcheckedstatus: Int? = null,

        @Column(name = "FDATA")
        val fdata: ByteArray? = null,

        @Column(name = "FADJUSTMAPDATA")
        val fadjustmapdata: ByteArray? = null,

        @Column(name = "FDATASOURCE")
        val fdatasource: Int? = null,

        @Column(name = "FSTATE")
        val fstate: Int? = null,

        @Column(name = "FEXECUTESTATE")
        val fexecutestate: Int? = null,

        @Column(name = "FBGSCHEMEID")
        val fbgschemeid: String? = null,

        @Column(name = "FBGTEMPLATEID")
        val fbgtemplateid: String? = null,

        @Column(name = "FBGPERIODID")
        val fbgperiodid: String? = null,

        @Column(name = "FBGROLLPERIODID")
        val fbgrollperiodid: String? = null,

        @Column(name = "FORGUNITID")
        val forgunitid: String? = null,

        @Column(name = "FBGTYPEID")
        val fbgtypeid: String? = null,

        @Column(name = "FMEASUREUNITID")
        val fmeasureunitid: String? = null,

        @Column(name = "FVERSIONNO")
        val fversionno: Long? = 0,

        @Column(name = "FADJUSTID")
        val fadjustid: String? = null,

        @Column(name = "FTEMPLATELASTUPDATETIME")
        val ftemplatelastupdatetime: Timestamp? = null,

        @Column(name = "FXNUM")
        val fxnum: String? = null,

        @Column(name = "FISCHANGETYPE")
        val fischangetype: Int? = null,

        @Column(name = "FCOURSEORGID")
        val fcourseorgid: String? = null,

        @Column(name = "FCOURSEUSERID")
        val fcourseuserid: String? = null,

        @Column(name = "FCOURSETIME")
        val fcoursetime: Timestamp? = null,

        @Column(name = "FCERTIFICATEUSERID")
        val fcertificateuserid: String? = null,

        @Column(name = "FCERTIFICATETIME")
        val fcertificatetime: Timestamp? = null,

        @Column(name = "FBACKUSERID")
        val fbackuserid: String? = null,

        @Column(name = "FBACKTIME")
        val fbacktime: Timestamp? = null,

        @Column(name = "FSTATEBEFOREAUDIT")
        val fstatebeforeaudit: Int? = null,

        @Column(name = "FRECORD")
        val frecord: Int? = null,

        @Column(name = "FISCONFIRM")
        val fisconfirm: Int? = 0,

        @Column(name = "FORGTYPE")
        val forgtype: Int? = 0,

        @Column(name = "FBGVERSIONID")
        val fbgversionid: String? = null
)

@Repository
interface TMbgBgFormRepo : CrudRepository<TMbgBgForm, String>, JpaSpecificationExecutor<TMbgBgForm>